Page({
  data:{
    repairList:{}
  },
  onShow() {
    this.getRepairList()
  },

  // 获取报修列表信息
  async getRepairList() {
    const res = await wx.http.get('/repair', { current: 1, pageSize: 10 })
    // console.log(res);
    if (res.code !== 10000) wx.utils.toast('获取报修列表失败')
    this.setData({
      repairList: res.data.rows
    })
  },
  goDetail(e) {
    // console.log(e);
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + e.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
